//
//  BaseNavController.swift
//  AutoRotation
//
//  Created by Wei Zhou on 2017/6/1.
//  Copyright © 2017年 Wulian. All rights reserved.
//

import UIKit

class BaseNavController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    var canRotation = false
    

    override var shouldAutorotate: Bool {
        print("shouldAutorotate : \(self.topViewController!.shouldAutorotate)")
        return (self.topViewController?.shouldAutorotate) ?? false
    }
    
    override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
        print("supportedInterfaceOrientations : \((self.topViewController?.supportedInterfaceOrientations) == .portrait)")
        return (self.topViewController?.supportedInterfaceOrientations) ?? .portrait
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
